import { Form, Input, Button, NavBar } from "antd-mobile";
import { useNavigate } from "react-router-dom";
import { editgerenAPI } from "../services/user";

function Xiugai() {
  const nav = useNavigate();
  const back = () => nav(-1);
  return (
    <div>
      <NavBar back="返回" onBack={back}></NavBar>
      <Form
        layout="horizontal"
        footer={
          <Button block type="submit" color="primary" size="large">
            提交
          </Button>
        }
        onFinish={(v) => {
          editgerenAPI(v);
          nav("/user");
        }}
      >
        <Form.Item name="nickName" label="姓名">
          <Input placeholder="请输入姓名" />
        </Form.Item>

        <Form.Item label="手机号" name="mobile">
          <Input placeholder="请输入手机号"></Input>
        </Form.Item>
      </Form>
    </div>
  );
}

export default Xiugai;
